* @param int $rescnt The number of items returned by our database query.
* @param int $dbcnt The number of items according to the category table.
* @param string $type 'subcat', 'article', or 'file'
- * @return String: A message giving the number of items, to output to HTML.
+ * @return string: A message giving the number of items, to output to HTML.
*/
private function getCountMessage( $rescnt, $dbcnt, $type ) {
- # There are three cases:
- # 1) The category table figure seems sane. It might be wrong, but
- # we can't do anything about it if we don't recalculate it on ev-
- # ery category view.
- # 2) The category table figure isn't sane, like it's smaller than the
- # number of actual results, *but* the number of results is less
- # than $this->limit and there's no offset. In this case we still
- # know the right figure.
- # 3) We have no idea.
-
- # Check if there's a "from" or "until" for anything
+ // There are three cases:
+ // 1) The category table figure seems sane. It might be wrong, but
+ // we can't do anything about it if we don't recalculate it on ev-
+ // ery category view.
+ // 2) The category table figure isn't sane, like it's smaller than the
+ // number of actual results, *but* the number of results is less
+ // than $this->limit and there's no offset. In this case we still
+ // know the right figure.
+ // 3) We have no idea.
+
+ // Check if there's a "from" or "until" for anything
// This is a little ugly, but we seem to use different names
// for the paging types then for the messages.
if ( $dbcnt == $rescnt ||
( ( $rescnt == $this->limit || $fromOrUntil ) && $dbcnt > $rescnt )
) {
- # Case 1: seems sane.
+ // Case 1: seems sane.
$totalcnt = $dbcnt;
} elseif ( $rescnt < $this->limit && !$fromOrUntil ) {
- # Case 2: not sane, but salvageable. Use the number of results.
- # Since there are fewer than 200, we can also take this opportunity
- # to refresh the incorrect category table entry -- which should be
- # quick due to the small number of entries.
+ // Case 2: not sane, but salvageable. Use the number of results.
+ // Since there are fewer than 200, we can also take this opportunity
+ // to refresh the incorrect category table entry -- which should be
+ // quick due to the small number of entries.
$totalcnt = $rescnt;
$this->cat->refreshCounts();
} else {
- # Case 3: hopeless. Don't give a total count at all.
- # Give grep a chance to find the usages: category-subcat-count-limited,
- # category-article-count-limited, category-file-count-limited
+ // Case 3: hopeless. Don't give a total count at all.
+ // Messages: category-subcat-count-limited, category-article-count-limited,
+ // category-file-count-limited
return $this->msg( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock();
}
- # Give grep a chance to find the usages:
- # category-subcat-count, category-article-count, category-file-count
+ // Messages: category-subcat-count, category-article-count, category-file-count
return $this->msg( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock();
}
}
$undoMsg = 'norev';
}
- // Give grep a chance to find the usages: undo-success, undo-failure, undo-norev
+ // Messages: undo-success, undo-failure, undo-norev
$class = ( $undoMsg == 'success' ? '' : 'error ' ) . "mw-undo-{$undoMsg}";
$this->editFormPageTop .= $wgOut->parse( "<div class=\"{$class}\">" .
wfMessage( 'undo-' . $undoMsg )->plain() . '</div>', true, /* interface */true );
foreach ( $watchTypes as $action => $pref ) {
if ( $user->isAllowed( $action ) ) {
- // Give grep a chance to find the usages:
+ // Messages:
// tog-watchdefault, tog-watchmoves, tog-watchdeletion, tog-watchcreations
$defaultPreferences[$pref] = array(
'type' => 'toggle',
Xml::openElement( 'table', array( 'id' => 'mwProtectSet' ) ) .
Xml::openElement( 'tbody' );
+ // Not all languages have V_x <-> N_x relation
foreach ( $this->mRestrictions as $action => $selected ) {
- /* Not all languages have V_x <-> N_x relation */
- // Give grep a chance to find the usages:
+ // Messages:
// restriction-edit, restriction-move, restriction-create, restriction-upload
$msg = wfMessage( 'restriction-' . $action );
$out .= "<tr><td>" .
static function getSkinNameMessages() {
$messages = array();
foreach ( self::getSkinNames() as $skinKey => $skinName ) {
- // Give grep a chance to find the usages:
- // skinname-cologneblue, skinname-monobook, skinname-modern, skinname-vector
+ // Messages: skinname-cologneblue, skinname-monobook, skinname-modern, skinname-vector
$messages[] = "skinname-$skinKey";
}
return $messages;
if ( $out->isSyndicated() ) {
$feeds = array();
foreach ( $out->getSyndicationLinks() as $format => $link ) {
- // Give grep a chance to find the usages: feed-atom, feed-rss
$feeds[$format] = array(
+ // Messages: feed-atom, feed-rss
'text' => $this->msg( "feed-$format" )->text(),
'href' => $link
);
} elseif ( $type === true ) {
$message = 'confirmemail_body_changed';
} else {
- // Give grep a chance to find the usages:
- // confirmemail_body_changed, confirmemail_body_set
+ // Messages: confirmemail_body_changed, confirmemail_body_set
$message = 'confirmemail_body_' . $type;
}
# Replace this after transforming the message, bug 35019
$postTransformKeys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary;
- # Now build message's subject and body
- # Give grep a chance to find the usages: enotif_subject_deleted, enotif_subject_created,
- # enotif_subject_moved, enotif_subject_restored, enotif_subject_changed
+ // Now build message's subject and body
+
+ // Messages:
+ // enotif_subject_deleted, enotif_subject_created, enotif_subject_moved,
+ // enotif_subject_restored, enotif_subject_changed
$this->subject = wfMessage( 'enotif_subject_' . $this->pageStatus )->inContentLanguage()
->params( $pageTitle, $keys['$PAGEEDITOR'] )->text();
- # Give grep a chance to find the usages: enotif_body_intro_deleted, enotif_body_intro_created,
- # enotif_body_intro_moved, enotif_body_intro_restored, enotif_body_intro_changed
+ // Messages:
+ // enotif_body_intro_deleted, enotif_body_intro_created, enotif_body_intro_moved,
+ // enotif_body_intro_restored, enotif_body_intro_changed
$keys['$PAGEINTRO'] = wfMessage( 'enotif_body_intro_' . $this->pageStatus )
->inContentLanguage()->params( $pageTitle, $keys['$PAGEEDITOR'], $pageTitleUrl )
->text();
// Render page information
foreach ( $pageInfo as $header => $infoTable ) {
- // Give grep a chance to find the usages:
+ // Messages:
// pageinfo-header-basic, pageinfo-header-edits, pageinfo-header-restrictions,
// pageinfo-header-properties, pageinfo-category-info
$content .= $this->makeHeader( $this->msg( "pageinfo-${header}" )->escaped() ) . "\n";
// Use robot policy logic
$policy = $this->page->getRobotPolicy( 'view', $pOutput );
- // Give grep a chance to find the usages: pageinfo-robot-index, pageinfo-robot-noindex
$pageInfo['header-basic'][] = array(
+ // Messages: pageinfo-robot-index, pageinfo-robot-noindex
$this->msg( 'pageinfo-robot-policy' ), $this->msg( "pageinfo-robot-${policy['index']}" )
);
$message = $this->msg( 'protect-default' )->escaped();
} else {
// Administrators only
- // Give grep a chance to find the usages:
- // protect-level-autoconfirmed, protect-level-sysop
+ // Messages: protect-level-autoconfirmed, protect-level-sysop
$message = $this->msg( "protect-level-$protectionLevel" );
if ( $message->isDisabled() ) {
// Require "$1" permission
}
}
- // Give grep a chance to find the usages:
- // restriction-edit, restriction-move, restriction-create, restriction-upload
+ // Messages: restriction-edit, restriction-move, restriction-create,
+ // restriction-upload
$pageInfo['header-restrictions'][] = array(
$this->msg( "restriction-$restrictionType" ), $message
);
}
public function startStage( $step ) {
- // Give grep a chance to find the usages: config-install-database, config-install-tables,
- // config-install-interwiki, config-install-stats, config-install-keys, config-install-sysop,
- // config-install-mainpage
+ // Messages: config-install-database, config-install-tables, config-install-interwiki,
+ // config-install-stats, config-install-keys, config-install-sysop, config-install-mainpage
$this->showMessage( "config-install-$step" );
}
* @return String
*/
public function getReadableName() {
- // Give grep a chance to find the usages:
- // config-type-mysql, config-type-postgres, config-type-sqlite, config-type-oracle
+ // Messages: config-type-mysql, config-type-postgres, config-type-sqlite,
+ // config-type-oracle
return wfMessage( 'config-type-' . $this->getName() )->text();
}
$allNames = array();
- // Give grep a chance to find the usages:
- // config-type-mysql, config-type-postgres, config-type-oracle, config-type-sqlite
+ // Messages: config-type-mysql, config-type-postgres, config-type-oracle,
+ // config-type-sqlite
foreach ( self::getDBTypes() as $name ) {
$allNames[] = wfMessage( "config-type-$name" )->text();
}
/**
* Called by execute() before page output starts, to show a page list.
*
- * @param $currentPageName String
+ * @param $currentPageName string
*/
private function startPageWrapper( $currentPageName ) {
$s = "<div class=\"config-page-wrapper\">\n";
$s .= "</ul><br/><ul>\n";
$s .= $this->getPageListItem( 'Restart', true, $currentPageName );
- $s .= "</ul></div>\n"; // end list pane
- // Give grep a chance to find the usages:
+ // End list pane
+ $s .= "</ul></div>\n";
+
+ // Messages:
// config-page-language, config-page-welcome, config-page-dbconnect, config-page-upgrade,
// config-page-dbsettings, config-page-name, config-page-options, config-page-install,
// config-page-complete, config-page-restart, config-page-readme, config-page-releasenotes,
/**
* Get a list item for the page list.
*
- * @param $pageName String
- * @param $enabled Boolean
- * @param $currentPageName String
+ * @param $pageName string
+ * @param $enabled boolean
+ * @param $currentPageName string
*
* @return string
*/
private function getPageListItem( $pageName, $enabled, $currentPageName ) {
$s = "<li class=\"config-page-list-item\">";
- // Give grep a chance to find the usages:
+
+ // Messages:
// config-page-language, config-page-welcome, config-page-dbconnect, config-page-upgrade,
// config-page-dbsettings, config-page-name, config-page-options, config-page-install,
// config-page-complete, config-page-restart, config-page-readme, config-page-releasenotes,
);
}
+ /**
+ * @param string|bool $continue
+ * @param string|bool $back
+ */
public function endForm( $continue = 'continue', $back = 'back' ) {
$s = "<div class=\"config-submit\">\n";
$id = $this->getId();
if ( $continue ) {
// Fake submit button for enter keypress (bug 26267)
- // Give grep a chance to find the usages: config-continue
+ // Messages: config-continue, config-restart, config-regenerate
$s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
array( 'name' => "enter-$continue", 'style' =>
'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
}
if ( $back ) {
- // Give grep a chance to find the usages: config-back
+ // Message: config-back
$s .= Xml::submitButton( wfMessage( "config-$back" )->text(),
array(
'name' => "submit-$back",
}
if ( $continue ) {
- // Give grep a chance to find the usages: config-continue
+ // Messages: config-continue, config-restart, config-regenerate
$s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
array(
'name' => "submit-$continue",
$settings = '';
$defaultType = $this->getVar( 'wgDBtype' );
- // Give grep a chance to find the usages:
- // config-support-mysql, config-support-postgres, config-support-oracle, config-support-sqlite
+ // Messages: config-support-mysql, config-support-postgres, config-support-oracle,
+ // config-support-sqlite
$dbSupport = '';
foreach ( $this->parent->getDBTypes() as $type ) {
$link = DatabaseBase::factory( $type )->getSoftwareLink();
) .
"</li>\n";
- // Give grep a chance to find the usages:
- // config-header-mysql, config-header-postgres, config-header-oracle, config-header-sqlite
+ // Messages: config-header-mysql, config-header-postgres, config-header-oracle,
+ // config-header-sqlite
$settings .=
Html::openElement( 'div', array( 'id' => 'DB_wrapper_' . $type,
'class' => 'dbWrapper' ) ) .
return false;
}
} elseif ( in_array( $code, array_keys( $this->parent->licenses ) ) ) {
- // Give grep a chance to find the usages:
+ // Messages:
// config-license-cc-by, config-license-cc-by-sa, config-license-cc-by-nc-sa,
- // config-license-cc-0, config-license-pd, config-license-gfdl,
- // config-license-none, config-license-cc-choose
+ // config-license-cc-0, config-license-pd, config-license-gfdl, config-license-none,
+ // config-license-cc-choose
$entry = $this->parent->licenses[$code];
if ( isset( $entry['text'] ) ) {
$this->setVar( 'wgRightsText', $entry['text'] );
}
public function startStage( $step ) {
- // Give grep a chance to find the usages: config-install-database, config-install-tables,
- // config-install-interwiki, config-install-stats, config-install-keys, config-install-sysop,
- // config-install-mainpage
+ // Messages: config-install-database, config-install-tables, config-install-interwiki,
+ // config-install-stats, config-install-keys, config-install-sysop, config-install-mainpage
$this->addHTML( "<li>" . wfMessage( "config-install-$step" )->escaped() . wfMessage( 'ellipsis' )->escaped() );
if ( $step == 'extension-tables' ) {
$this->startLiveBox();
return true;
}
- # Check for a suppression tag (used e.g. in periodically archived discussions)
+ // Check for a suppression tag (used e.g. in periodically archived discussions)
$mw = MagicWord::get( 'staticredirect' );
if ( $content->matchMagicWord( $mw ) ) {
wfDebug( __METHOD__ . ": skipping: suppressed with __STATICREDIRECT__\n" );
return true;
}
- # Find the current final destination
+ // Find the current final destination
$newTitle = self::getFinalDestination( $this->redirTitle );
if ( !$newTitle ) {
wfDebug( __METHOD__ . ": skipping: single redirect, circular redirect or invalid redirect destination\n" );
return true;
}
if ( $newTitle->equals( $this->redirTitle ) ) {
- # The redirect is already right, no need to change it
- # This can happen if the page was moved back (say after vandalism)
+ // The redirect is already right, no need to change it
+ // This can happen if the page was moved back (say after vandalism)
wfDebug( __METHOD__ . " : skipping, already good\n" );
}
- # Preserve fragment (bug 14904)
+ // Preserve fragment (bug 14904)
$newTitle = Title::makeTitle( $newTitle->getNamespace(), $newTitle->getDBkey(),
$currentDest->getFragment(), $newTitle->getInterwiki() );
- # Fix the text
+ // Fix the text
$newContent = $content->updateRedirect( $newTitle );
if ( $newContent->equals( $content ) ) {
return false;
}
- # Save it
+ // Save it
global $wgUser;
$oldUser = $wgUser;
$wgUser = $user;
$article = WikiPage::factory( $this->title );
- // Give grep a chance to find the usages:
- // double-redirect-fixed-move, double-redirect-fixed-maintenance
+
+ // Messages: double-redirect-fixed-move, double-redirect-fixed-maintenance
$reason = wfMessage( 'double-redirect-fixed-' . $this->reason,
$this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText()
)->inContentLanguage()->text();
public static function getFinalDestination( $title ) {
$dbw = wfGetDB( DB_MASTER );
- $seenTitles = array(); # Circular redirect check
+ // Circular redirect check
+ $seenTitles = array();
$dest = false;
while ( true ) {
$out->addHtml( $summary );
} elseif ( isset( self::$frameworks[$framework] ) ) {
// Matched! Display proper title and initialize the framework
- // Give grep a chance to find the usages: javascripttest-qunit-name
$out->setPageTitle( $this->msg(
'javascripttest-title',
+ // Messages: javascripttest-qunit-name
$this->msg( "javascripttest-$framework-name" )->plain()
) );
$out->setSubtitle( $this->msg( 'javascripttest-backlink' )
private function getFrameworkListHtml() {
$list = '<ul>';
foreach ( self::$frameworks as $framework => $initFn ) {
- // Give grep a chance to find the usages: javascripttest-qunit-name
$list .= Html::rawElement(
'li',
array(),
Linker::link(
$this->getTitle( $framework ),
+ // Message: javascripttest-qunit-name
$this->msg( "javascripttest-$framework-name" )->escaped()
)
);
$description_items = array();
- // Give grep a chance to find the usages:
- // restriction-level-sysop, restriction-level-autoconfirmed
+ // Messages: restriction-level-sysop, restriction-level-autoconfirmed
$protType = $this->msg( 'restriction-level-' . $row->pr_level )->escaped();
$description_items[] = $protType;
$stxt = $lang->getDirMark() . ' ' . Linker::formatRevisionSize( $size );
}
- # Show a link to the change protection form for allowed users otherwise
- # a link to the protection log
+ // Show a link to the change protection form for allowed users otherwise
+ // a link to the protection log
if ( $this->getUser()->isAllowed( 'protect' ) ) {
$changeProtection = Linker::linkKnown(
$title,
// First pass to load the log names
foreach ( Title::getFilteredRestrictionTypes( true ) as $type ) {
- // Give grep a chance to find the usages:
- // restriction-edit, restriction-move, restriction-create, restriction-upload
+ // Messages: restriction-edit, restriction-move, restriction-create, restriction-upload
$text = $this->msg( "restriction-$type" )->text();
$m[$text] = $type;
}
$link = Linker::link( $title );
$description_items = array();
- // Give grep a chance to find the usages:
- // restriction-level-sysop, restriction-level-autoconfirmed
+ // Messages: restriction-level-sysop, restriction-level-autoconfirmed
$protType = $this->msg( 'restriction-level-' . $row->pt_create_perm )->escaped();
$description_items[] = $protType;
$lang = $this->getLanguage();
// First pass to load the log names
foreach ( $wgRestrictionLevels as $type ) {
if ( $type != '' && $type != '*' ) {
- // Give grep a chance to find the usages:
- // restriction-level-sysop, restriction-level-autoconfirmed
+ // Messages: restriction-level-sysop, restriction-level-autoconfirmed
$text = $this->msg( "restriction-level-$type" )->text();
$m[$text] = $type;
}
$allgroups = $this->getAllGroups();
$ret = '';
- # Put all column info into an associative array so that extensions can
- # more easily manage it.
+ // Put all column info into an associative array so that extensions can
+ // more easily manage it.
$columns = array( 'unchangeable' => array(), 'changeable' => array() );
foreach ( $allgroups as $group ) {
$set = in_array( $group, $usergroups );
- # Should the checkbox be disabled?
+ // Should the checkbox be disabled?
$disabled = !(
( $set && $this->canRemove( $group ) ) ||
( !$set && $this->canAdd( $group ) ) );
- # Do we need to point out that this action is irreversible?
+ // Do we need to point out that this action is irreversible?
$irreversible = !$disabled && (
( $set && !$this->canAdd( $group ) ) ||
( !$set && !$this->canRemove( $group ) ) );
}
}
- # Build the HTML table
+ // Build the HTML table
$ret .= Xml::openElement( 'table', array( 'class' => 'mw-userrights-groups' ) ) .
"<tr>\n";
foreach ( $columns as $name => $column ) {
if ( $column === array() ) {
continue;
}
- // Give grep a chance to find the usages: userrights-changeable-col, userrights-unchangeable-col
+ // Messages: userrights-changeable-col, userrights-unchangeable-col
$ret .= Xml::element( 'th', null, $this->msg( 'userrights-' . $name . '-col', count( $column ) )->text() );
}
$ret .= "</tr>\n<tr>\n";
* @return bool Can we remove the group?
*/
private function canRemove( $group ) {
- // $this->changeableGroups()['remove'] doesn't work, of course. Thanks,
- // PHP.
+ // $this->changeableGroups()['remove'] doesn't work, of course. Thanks, PHP.
$groups = $this->changeableGroups();
return in_array( $group, $groups['remove'] ) || ( $this->isself && in_array( $group, $groups['remove-self'] ) );
}
$segments = array();
foreach ( $intervals as $intervalName => $intervalValue ) {
- // Give grep a chance to find the usages:
- // duration-centuries, duration-decades, duration-years, duration-days,
+ // Messages: duration-centuries, duration-decades, duration-years, duration-days,
// duration-hours, duration-minutes, duration-seconds
$message = wfMessage( 'duration-' . $intervalName )->numParams( $intervalValue );
$segments[] = $message->inLanguage( $this )->escaped();